package CodeOne;

import java.util.Calendar;
import java.util.Scanner;
/** @author ASUS */
public class DealCalendar {
  public static void main(String[] args) {
    Scanner inputscanner = new Scanner(System.in);
    while (inputscanner.hasNextLine()) {
      String string = inputscanner.nextLine();
      String[] part = string.split(" ");
      int year = Integer.parseInt(part[0]);
      int delay = Integer.parseInt(part[1]);
      Calendar calendar = Calendar.getInstance();
      calendar.set(year, Calendar.JANUARY, 1);
      calendar.add(Calendar.DATE, delay - 1);
      int tempyear = calendar.get(Calendar.YEAR);
      int tempmonth = calendar.get(Calendar.MONTH) + 1;
      int tempdays = calendar.get(Calendar.DAY_OF_MONTH);
      System.out.printf("%d-%02d-%02d\n", tempyear, tempmonth, tempdays);
    }
  }
}
